package com.example.admin.yuejian21.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.admin.yuejian21.Bean.Pic;
import com.example.admin.yuejian21.Bean.shaitu;
import com.example.admin.yuejian21.R;

import it.sephiroth.android.library.picasso.Picasso;

import static com.example.admin.yuejian21.Adapter.PicAdapter.photo1;
import static com.example.admin.yuejian21.Adapter.PicAdapter.usernamest;
import static com.example.admin.yuejian21.activity.LoginActivity.username;

public class ShaituDetailActivity extends AppCompatActivity {
    private shaitu pic;
    private ImageView userView;
    private ImageView picview;
    private TextView usernameView;
    private TextView titleview;
    String SessionID="060pn7sjorpnq5fp53kid5st54";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shaitu_detail);
        userView = (ImageView) findViewById(R.id.imageView_stuser1);
        picview =
                (ImageView) findViewById(R.id.imageView_stpic11);
        usernameView = (TextView) findViewById(R.id.textView_stusername1);
        titleview = (TextView) findViewById(R.id.sttitle1);

        pic=getIntent().getParcelableExtra("pic");

        if (pic != null) {


                usernameView.setText(username);

            Picasso
                    .with(ShaituDetailActivity.this)
                    .load("http://172.24.10.175/workout/Uploads/"+pic.getThumb0())


                    .into(picview);

            titleview.setText(pic.getTitle());
            if (!(photo1==null))

            {
                Picasso
                        .with(ShaituDetailActivity.this)
                        .load("http://172.24.10.175/workout/Uploads/" +photo1)


                        .into(userView);
            }
        }
    }




}

